//
//  SelectphotoViewController.m
//  SUZHOUBANK
//
//  Created by apple on 16/4/13.
//  Copyright © 2016年 RuiFeng-WGCC. All rights reserved.
//

#import "SelectphotoViewController.h"

@interface SelectphotoViewController ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate>{
    UIImagePickerController  *_imagePickerController;/**< 图片拾取器 */
    NSMutableArray *_imageNames;
}


@end

@implementation SelectphotoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray  *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        
        _imagePickerController.sourceType =UIImagePickerControllerSourceTypePhotoLibrary ;
        NSLog(@"%@",mediaTypes);
        _imagePickerController.mediaTypes = @[mediaTypes[0]];
        _imagePickerController.allowsEditing = YES;
        
        [self presentViewController:_imagePickerController animated:YES completion:nil];

}

}

#pragma mark --UINavigationControllerDelegate UIImagePickerControllerDelegate

-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
    [self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
    
}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
  
//    self.imageView.image  = editedImage;
    [self.presentedViewController dismissViewControllerAnimated:YES
                                                     completion:nil];
}


@end
